import React from 'react';
import {connect} from 'react-redux';
import {locationTo, back} from '../utils/LocationUtil';
import PropTypes from 'prop-types'
import '../css/header.css'
class Header extends React.Component {
    static propTypes = {
        title: PropTypes.string.isRequired,
        showBack: PropTypes.bool.isRequired,
        showShare: PropTypes.bool.isRequired,
    };
    render() {
        return (
            <div className="header">
                {this.props.showBack?<img className="back" src='/authen/img/header/left.png' onClick={()=>{
                    back()
                }}/>: null}
                <span className="title">{this.props.title}</span>
                {this.props.showShare?<img className="back" src='/authen/img/header/left.png' onClick={()=>{
                    back()
                }}/>: <span className="back"/>}
            </div>
        )
    }
}
export default Header